using Microsoft.CRM.ThirdParty.Extensions.ProjectCreator.Services;

namespace Microsoft.CRM.ThirdParty.Extensions.ProjectCreator.Presentation
{
    public class ProjectCreationFormPresenter
    {
        private readonly IProjectCreationFormView _view;
        private readonly IProjectCreationService _projectCreationService;

        public ProjectCreationFormPresenter(IProjectCreationFormView view)
            : this(view, new ProjectCreationService())
        {
        }

        public ProjectCreationFormPresenter(IProjectCreationFormView view, IProjectCreationService projectCreationService)
        {
            _view = view;
            _projectCreationService = projectCreationService;
        }

        public void CreateProject()
        {
            string project_folder = _view.ProjectFolder;
            string project_name = _view.ProjectName;

            _projectCreationService.CreateProject(project_name, project_folder);

        }
    }
}